package com.msi;

import org.junit.*;
import static org.junit.Assert.*;

public class VertexTests {

    @Test
    public void test_equals(){
        Vertex v1 = new Vertex(0);
        Vertex v2 = new Vertex(0);
        Vertex v3 = new Vertex(1);
        Object someObject = new Object();
        
        assertTrue(v1.equals(v1));
        assertTrue(v1.equals(v2));
        assertFalse(v1.equals(v3));
        assertFalse(v1.equals(null));
        assertFalse(v1.equals(someObject));
    }
    
    
    @Test
    public void test_hashCode(){
        Vertex v1 = new Vertex(0);
        Vertex v2 = new Vertex(0);
        Vertex v3 = new Vertex(1);
        
        assertTrue(v1.hashCode() == v2.hashCode());
        assertFalse(v1.hashCode() == v3.hashCode());
    }
    
    
    @Test
    public void test_visited(){
        Vertex v1 = new Vertex(0);
        
        assertFalse(v1.isVisited());
        
        v1.markAsVisited();
        assertTrue(v1.isVisited());
    }
}
